/*
 * rule_info.h
 *
 *  Created on: 2012/09/19
 *      Author: softwareDeveloper
 */

#ifndef RULE_INFO_H_
#define RULE_INFO_H_

#include "typedef.h"
#include "Id.h"

/*check result flag*/
#define RULE_RESULT_OK	0
#define RULE_RESULT_NG	1

/*message rank flag*/
#define MSG_RANK_INFO	1
#define MSG_RANK_WARN	2
#define MSG_RANK_ERR	3

#define MSG_BUF_SIZE	128

/*all rules output info*/
typedef struct _RULEOUT {
	AST indexInfo;
	AST fileIndex;
	S4 beginLine;
	S4 beginCol;
	S4 endLine;
	S4 endCol;
	PSZ ruleID;
	U2 errRank;
	CHAR msgBuf_eng[MSG_BUF_SIZE];
	CHAR msgBuf_chs[MSG_BUF_SIZE];
	CHAR msgBuf_jpn[MSG_BUF_SIZE];
	AST rfileIndex;
	S4 rlocLine;
	struct _RULEOUT * next;
} RULEOUT, *PRULEOUT;

typedef struct _RULEMAN {
	PSZ ruleID;
	BOOL ruleSwitch;
	PRULEOUT * headOut;
	PRULEOUT * tailOut;
	S4 (*ruleMain_cmd)(AST, U4);
	S4 (*ruleMain_ast)(U2, AST, U4);
	S4 (*ruleMain_cpp)(AST, AST);
	struct _RULEMAN * nextRule;
} RULEMAN, *PRULEMAN;
extern PRULEMAN stRuleManager;

#endif /* RULES_H_ */
